<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/5/23
 * Time: 15:40
 */

namespace Admin\Model;


class LibraryModel extends BaseModel
{
    // 数据表名（不包含表前缀）
    protected $tableName        =   'library';

    /**
     * 查询图书馆界面信息
     * @return array()
    **/
    public function getLibraryInfo(){
        return $this->where("library_id = 1")->find();
    }
    /**
     * @param String $library_top_title 网站图标
     * @param String $library_title BANNER文字
     * @param String $library_search_book 热门搜索
     * @param String $library_title_left 左标题
     * @param String $library_content_left 左标题内容
     * @param String $library_title_right 右标题
     * @param String $library_content_right 右标题内容
     * @param String $library_title_center 网站图标
     * @param String $library_content_center 网站图标
     * @param String $library_bottom_content 网站图标
     * @param String $library_copyright 网站图标
     * @param String $library_bottom_title 网站图标
     * @return boolean
    **/
    public function librarySaveInfo($library_top_title,$library_title,$library_search_book,$library_title_left,$library_content_left,$library_title_right,$library_content_right,$library_title_center,$library_content_center,$library_bottom_content,$library_copyright,$library_bottom_title){
        $data['library_top_title']=$library_top_title;
        $data['library_title']=$library_title;
        $data['library_search_book']=$library_search_book;
        $data['library_title_left']=$library_title_left;
        $data['library_content_left']=$library_content_left;
        $data['library_title_right']=$library_title_right;
        $data['library_content_right']=$library_content_right;
        $data['library_title_center']=$library_title_center;
        $data['library_content_center']=$library_content_center;
        $data['library_bottom_content']=$library_bottom_content;
        $data['library_copyright']=$library_copyright;
        $data['library_bottom_title']=$library_bottom_title;
        $res=$this->where("library_id=1")->save($data);
        if($res>0){
            return true;
        }else{
            return false;
        }
    }
}